package com.situ.vivamarket.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

@Setter
@Getter
@JsonIgnoreProperties("handler")
public class Goods {
    private Integer id;
    @NotEmpty(message = "sku编号不能为空")
    private String skuNo;//sku编码
    @NotEmpty(message = "商品名称不能为空")
    private String name;
    private String alias;//商品别名
    private String summary;//摘要描述
    private Integer categoryId;//类别编号
    private Integer brandId;//品牌编号
    private BigDecimal markPrice;//标价
    @NotNull(message = "商品价格不能为空")
    @Min(value = 0, message = "商品价格不能低于0")
    private BigDecimal price;//售价
    @Min(value = 0, message = "库存数量不能低于0")
    private Integer qty;//库存数量
    @NotEmpty(message = "商品主图不能为空")
    private String pic;//主图
    @NotEmpty(message = "商品副图不能为空")
    private String pic1;//副图
    private List<String> otherPics;//细节图
    private String detail;//商品详情图文描述
    private String description;//简介，备注
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    private String createdBy;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastModifyTime;
    private String lastModifiedBy;

    private Category category;//所属类别
    private Brand brand;//所属品牌
}

